# coding: utf-8
from sqlalchemy import Column, DateTime, Integer, String, Text
from sqlalchemy.ext.declarative import declarative_base
import datetime
Base = declarative_base()
metadata = Base.metadata


class Info(Base):
    __tablename__ = 'info'
    id = Column(Integer, primary_key=True)
    pub_time = Column(DateTime)
    title = Column(String(200), default="")
    link = Column(String(150), default="")
    content = Column(Text, default="")
    pub_time = Column(DateTime)
    content = Column(Text)
    platform = Column(Integer)
    author = Column(String(100), default="")
    company = Column(String(100), default="")
    news_type = Column(String(100), default="")
    record_type = Column(Integer)
    create_date = Column(DateTime)


# 防止重复links
class IgnoreLink(Base):
    __tablename__ = 'ignore_link'
    id = Column(Integer, primary_key=True)
    link = Column(String(150), default="")
    create_date = Column(DateTime)


class Company(Base):
    __tablename__ = 'company'
    id = Column(Integer, primary_key=True)
    company_name = Column(String(150))
    code = Column(String(150))


def get_current_time():
    return datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")


if __name__ == '__main__':
    print get_current_time()

